package com.example.fushuang.balabala.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.example.fushuang.balabala.fragment.BaseFragment;

import java.util.List;

/**
 * Created by admin on 2016/10/12.
 */

public class CommenFragmentPagerAdapter extends FragmentPagerAdapter {
    private List<BaseFragment> mFragments;

    public CommenFragmentPagerAdapter(FragmentManager fm, List<BaseFragment> fragments) {
        super(fm);
        mFragments=fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mFragments.get(position).getFragmentTitle();
    }
}
